﻿using System.Collections.Generic;
using BookTheBook.Amazon;
using BookTheBook.Data;
using BookTheBook.Data.Model;

namespace BookTheBook.AmazonBookImporter
{
    public class Program
    {
        private static readonly List<string> _keywords = new List<string> { "c#", "java", "linq", "jQuery", "Algorithms", "NHibernate", "WCF" };

        //TODO: Move initialization to constructor, pass repository impl using DI
        private static readonly IBookEntitiesProvider _booksProvider = new AmazonBookEntitiesProvider();
        private static readonly ILibraryRepository _libraryRepository = new NHibernateLibraryRepository();

        private static void Main()
        {
            List<Book> bookEntitiesForKeywords;
            _booksProvider.GetBooksForGivenKeywords(_keywords, 1, out bookEntitiesForKeywords);
            _libraryRepository.AddBooksToLibrary(bookEntitiesForKeywords);
        }
    }
}